package site.wetsion.employ.server.mapper;

import java.math.BigInteger;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import site.wetsion.employ.server.pojo.Company;
import site.wetsion.employ.server.pojo.CompanyDetail;
import site.wetsion.employ.server.pojo.CompanyProduct;
import site.wetsion.employ.server.pojo.Domain;

public interface CompanyMapper {

	/** 查询所有的行业领域*/
	public List<Domain> getAllDomain() throws Exception;
	/** 根据id查询所在地名称*/
	public String getLocationNameById(BigInteger id) throws Exception;
	/** 根据id查询行业名称*/
	public String getDomainNameById(int id) throws Exception;
	/** 清空每日推荐*/
	public void deleteHotCompany() throws Exception;
	/** 添加每日推荐*/
	public void insertRecommedCompany(BigInteger id) throws Exception;
	/** 获取每日推荐*/
	public BigInteger getRecommedCompany() throws Exception;
	/**-----------   公司相关操作   ------------ **/
	
	/**    <--------------      插入操作   ----------------- >   */
	/** 插入公司信息*/
	public void insertCompany(Company company) throws Exception;
	/** 插入公司产品*/
	public void insertProduct(CompanyProduct companyProduct) throws Exception;
	/** 插入未审核公司产品*/
	public void insertProductUncheck(CompanyProduct companyProduct) throws Exception;
	/** 插入公司详情*/
	public void insertCompanyDetail(CompanyDetail detail) throws Exception;
	/** 插入未审核公司详情*/
	public void insertCompanyDetailUncheck(CompanyDetail detail) throws Exception;
	/** 插入公司信息到未审核公司列表*/
	public void insertCompanyUncheck(Company company) throws Exception;
	/**    <--------------      删除操作   ----------------- >   */
	/** 根据id删除公司*/
	public void deleteCompanyById(BigInteger id) throws Exception;
	/** 根据id删除公司详情*/
	public void deleteCompanyDetailById(BigInteger id) throws Exception;
	
	/** 根据id删除未审核公司详情*/
	public void deleteCompanyDetailUncheckById(BigInteger id) throws Exception;
	
	/** 根据id删除未审核公司*/
	public void deleteUncheckCompanyById(BigInteger id) throws Exception;
	
	/** 根据id删除未审核公司产品*/
	public void deleteCompanyPorductUncheckById(BigInteger id) throws Exception;
	
	
	/**    <--------------      修改操作   ----------------- >   */
	/** 修改公司信息*/
	public void updateCompany(Company company) throws Exception;
	/** 修改公司详情信息*/
	public void updateCompanyDetail(CompanyDetail detail) throws Exception;
	/** 修改公司产品*/
	public void updateCompanyProduct(CompanyProduct product) throws Exception;
	/**    <--------------      查询操作   ----------------- >   */
	/** 获取公司总数量*/
	public int getCompanyCount() throws Exception;
	/** 根据id获取公司信息*/
	public Company getCompanyById(BigInteger id) throws Exception;
	/** 根据id获取公司详情*/
	public CompanyDetail getCompanyDetailById(BigInteger id) throws Exception;
	/** 根据公司id获取公司产品*/
	public CompanyProduct getCompanyProductByCompanyId(BigInteger id) throws Exception;
	/** 分页查找公司*/
	public List<Company> getCompanysByPage(int page, int pageSize) throws Exception;
	/** 按照公司名称搜索，并分页*/
	public List<Company> getCompanyOnSearchNameByPage(@Param("page") int page, 
			@Param("pageSize") int pageSize, @Param("name") String name) throws Exception;
	/** 获取查询的关键字的记录数量*/
	public int getSearchCountByName(String name) throws Exception;
	/** 按行业分页查询*/
	public List<Company> getCompanyOnDomainByPage(@Param("page") int page, 
			@Param("pageSize") int pageSize, @Param("domain") int domain) throws Exception;

	
	/** 获取行业公司记录数量*/
	public int getCompanyCountByDomain(int domain) throws Exception;
	
	/** 获取最新发布的公司*/
	public List<Company> getLastCreatCompany(@Param("page") int page, 
			@Param("pageSize") int pageSize) throws Exception;
	
	/** 获取未审核公司总数量*/
	public int getUncheckCompanyCount() throws Exception;
	/** 分页查找未审核公司*/
	public List<Company> getUncheckCompanysByPage(int page, int pageSize) throws Exception;
	
	/** 根据id获取公司信息*/
	public Company getCompanyUncheckById(BigInteger id) throws Exception;
	/** 根据id获取公司详情*/
	public CompanyDetail getCompanyDetailUncheckById(BigInteger id) throws Exception;
	/** 根据公司id获取公司产品*/
	public CompanyProduct getCompanyProductUncheckByCompanyId(BigInteger id) throws Exception;
}
